<?php
namespace ctrl\demo;

class product
{
    //同步SKU产品表中新增的 http://ec.com/?c=demo_product&a=check
    public static function check()
    {
        \serv\task\product\product::check();
    }

    //检查是否存在此库存信息了 http://ec.com/?c=demo_product&a=checkProductStock
    public static function checkProductStock()
    {
        $string = '{"product_id":"131","icon":null,"sku":"A0039-FRLG-BL-AZR2","origin_sku":null,"sku_name":"B&B模块沙发-大脚踏-蓝色","sku_name_en":"SOFA","currency":"CNY","purchase_cost":null,"finance_cost":null,"weight":"23.90","length":"97.30","width":"93.30","height":"42.20","box_weight":"0.00","box_long":"0.00","box_width":"0.00","box_height":"0.00","product_attr":null,"status":"1","attachment":null,"sku_detail":null,"brand_id":null,"category_id":"794","supplier_id":null,"type":"1","button":null,"created_by":"1001","created_at":"2024-07-18 09:06:38","updated_by":"1001","updated_at":"2024-08-07 12:23:24"}';
        $data['data'] = json_decode($string, true);
        $result = \serv\queue\product\product::checkProductStock($data);
        var_dump($result);
    }
}